package br.com.fabrica.aid.aid_fabrica.business;

import br.com.fabrica.aid.aid_fabrica.domain.Colaborador;
import br.com.fabrica.aid.aid_fabrica.domain.Curso;
import br.com.fabrica.aid.aid_fabrica.persistence.ColaboradorDAO;
import br.gov.frameworkdemoiselle.lifecycle.Startup;
import br.gov.frameworkdemoiselle.stereotype.BusinessController;
import br.gov.frameworkdemoiselle.template.DelegateCrud;
import br.gov.frameworkdemoiselle.transaction.Transactional;

@BusinessController
public class ColaboradorBC extends DelegateCrud<Colaborador, Long, ColaboradorDAO> {
	
	private static final long serialVersionUID = 1L;
	
	@Startup
	@Transactional
	public void load() {
		if (findAll().isEmpty()) {
			insert(new Colaborador("Fulano", "32323", "fulano@email.com", "31212331", "000111222", Curso.CIENCIAS_COMPUTACAO, 1,true));
		}
	}


}
